package pers.twf.example;

import pers.twf.example.common.model.User;
import pers.twf.example.common.service.UserService;
import pers.twf.twfRpc.bootstrap.ConsumerBootstrap;
import pers.twf.twfRpc.proxy.ServiceProxyFactory;

/**
 * 消费者启动类
 */
public class ConsumerExample {
    public static void main(String[] args) {

        ConsumerBootstrap.init();

        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        User user = new User();
        user.setName("twfPlayer");
        User newUser = userService.getUser(user);
        if (newUser!=null){
            System.out.println(newUser.getName());
        }else {
            System.out.println("user = null");
        }
    }
}
